{include file="admin/top.php" subject='products'}
{include file="products/top.php" subject='products'}
<div id="content">
<div id="boxquery">
    <form method="get">
         <input type="hidden" name="m" value="inventory" />
        <input type="hidden" name="s" value="products.php" />
        <input type="submit" value="查询" class="fr" />
        <ul>
        <li><div style="line-height: 15px;float:left;">产品ID:&nbsp; </div><textarea id="product_id" name="product_id" style="resize:horizontal;float:left;height:30px;">{$smarty.get.product_id}</textarea></li>
        <li>仓库:&nbsp; <select id="shopid" name="shopid"><option value="">全部</option>{shops}<option value="{$shops.id}" {if $shops.id==$smarty.get.shopid}selected{/if}>{$shops.title}</option>{/shops}</select></li>
        <li>产品负责人:&nbsp; <select id="classid" name="classid"><option value="">全部</option><option value="0" {if $smarty.get.classid=='0'}selected{/if}>未指定</option>{classes}<option value="{$classes.id}" {if $classes.id==$smarty.get.classid}selected{/if}>{$classes.title}</option>{/classes}</select></li>
        <li>产品关键字:&nbsp; <input id="keywords" name="keywords" type="text" size="30" value="{$smarty.get.keywords}" />
        </li>
		<li>采购价:&nbsp; <input id="lprice" name="lprice" type="text" size="6" value="{$smarty.get.lprice}"/>-<input id="hprice" name="hprice" type="text" size="6" value="{$smarty.get.hprice}"/>
        </li>
        <li>预售数量:&nbsp; <input id="lwanttobuy" name="lwanttobuy" type="text" size="6" value="{$smarty.get.lwanttobuy}"/>-<input id="hwanttobuy" name="hwanttobuy" type="text" size="6" value="{$smarty.get.hwanttobuy}"/>
        </li>
        <li>实际库存:&nbsp; <input id="lstocks" name="lstocks" type="text" size="6" value="{$smarty.get.lstocks}"/>-<input id="hstocks" name="hstocks" type="text" size="6" value="{$smarty.get.hstocks}"/>
        </li>
        <li>虚拟库存:&nbsp; <input id="lvirstocks" name="lvirstocks" type="text" size="6" value="{$smarty.get.lvirstocks}"/>-<input id="hvirstocks" name="hvirstocks" type="text" size="6" value="{$smarty.get.hvirstocks}"/>
        </li>
        <li>预警数量:&nbsp; <input id="lwaringnum" name="lwaringnum" type="text" size="6" value="{$smarty.get.lwaringnum}"/>-<input id="hwaringnum" name="hwaringnum" type="text" size="6" value="{$smarty.get.hwaringnum}"/>
        </li>
        <li>
        <input type="hidden" id="setYs" name="setYs" value="0">
        <!--  
        <button onclick="if(!confirm('确认？'))return false;else $('#setYs').val(1);">批量将搜索列表中的商品的虚拟库存设置为预售数量</button>
        -->
        </li>
<!--          <li>库存:&nbsp; <input id="lnumber" name="lnumber" type="text" size="8" value="{$smarty.get.lnumber}"/>-<input id="hnumber" name="hnumber" type="text" size="8" value="{$smarty.get.hnumber}"/> -->
<!--         </li> -->
        </ul>
    </form>
    </div>
    <table width="100%" border="0" cellspacing="0" cellpadding="5" id="lister">
      <tr id="title">
        <td width="40">SKU_ID</td>
        <td width="40">产品ID</td>
        <td>产品图片</td>
        <td>产品名称</td>
        <td>发货仓</td>
<!--         <td width="160">供应商(负责人)</td> -->
        <td>单位</td>
<!--         <td>采购单价</td> -->
<!--         <td>货币单位</td> -->
<!--         <td>销售单价</td> -->
<!--         <td>销售底价</td> -->
<!--         <td>库存</td> -->
         <td>预售数量</td>
        <td>实际库存</td>
        <td>虚拟库存</td>
        <td>预警数量</td>
        <td>主站状态</td>
        <td>&nbsp;</td>
      </tr>
      {products limit=20 pager=pager page=$segment.page order="id desc" classid=$smarty.get.classid lnumber=$smarty.get.lnumber hnumber=$smarty.get.hnumber lotnumber=$smarty.get.lotnumber lprice=$smarty.get.lprice hprice=$smarty.get.hprice lwanttobuy=$smarty.get.lwanttobuy hwanttobuy=$smarty.get.hwanttobuy lstocks=$smarty.get.lstocks hstocks=$smarty.get.hstocks lvirstocks=$smarty.get.lvirstocks hvirstocks=$smarty.get.hvirstocks lwaringnum=$smarty.get.lwaringnum hwaringnum=$smarty.get.hwaringnum keywords=$smarty.get.keywords product_id=$smarty.get.product_id shopid=$smarty.get.shopid}
      <tr id="content">
        <td>{$products.product_sku_id}</td>
        <td>{$products.pid}</td>
        <td height="50">{if $products.product_pic}<img src="{$products.product_pic}" width="50" height="50" />{else}暂无图片{/if}</td>
        <td><a href="{$site_admin}m=inventory&s=products.php&uri=view&id={$products.id}">{$products.pname}</a> {$products.spec}</td>
         <td>{$products.shop_name}&nbsp;</td>
<!--                 <td>
        {if !empty($products.suppliers)}
        {foreach from=$products.suppliers item=supplier}
        	<p>{$supplier.title}({if $supplier.classid}{classes id=$supplier.classid}{$classes.title}{/classes}{else}未指定{/if})</p>
        {/foreach}
        {else}未指定{/if}
        </td> -->
        <td>{$products.unit}</td>
<!--         <td>{$products.pricebuy}&nbsp;</td> -->
<!--         <td>{$products.currency_unit}&nbsp;</td> -->
<!--         <td>{$products.pricesell}&nbsp;</td> -->
<!--         <td>{$products.priceundersell}&nbsp;</td> -->
        
<!--         <td>{if $products.stocks>0}{$products.stocks+0} {$products.unit}{/if}&nbsp;</td> -->
        <td>{$products.wanttobuy}</td>
        <td>{$products.stocks}</td>
        <td>{$products.canbuyout}</td>
        <td>{$products.shopwarningnum}</td>
        <td>{if "0"===$products.status}<span style="color:gray">未送审</span>{/if}
                {if "-2"===$products.status}<span style="color:orange">已送审</span>{/if}
                {if "1"===$products.status}<span style="color:green">已上架</span>{/if}
                {if "2"===$products.status}<span style="color:blue">推荐</span>{/if}
                {if "-1"===$products.status}<span style="color:red">被驳回</span>{/if}
                {if "-3"===$products.status||"-9"===$products.status}<span style="color:#ccc">已下架</span>{/if}</td>
        <td align="right">
        {if 0}{rights right='products_remove'}<a href="{$site_admin}m=inventory&s=products.php&uri=remove&id={$products.id}" onclick="return confirm('删除产品数据后不可恢复, 确定删除?')">删除</a>{/rights}{/if}
        {rights right='products_modify'}<a href="{$site_admin}m=inventory&s=products.php&uri=modify&id={$products.id}">编辑</a>{/rights}
        <a href="{$site_admin}m=inventory&s=products.php&uri=view&id={$products.id}">查看</a>
        <a href="{$site_admin}m=inventory&s=supplieProducts.php&uri=create&pid={$products.pid}">加供应商</a>
        </td>
      </tr>
      {/products}
      {if $pager->rows==0}
      <tr id="content">
        <td colspan="20">&nbsp;</td>
      </tr>
      {/if}
    </table>
    <div id="pager" class="mt10">
        {if $pager} 共{$pager->rows}条记录 第{$pager->pagecurrent}/{$pager->pages}页 {/if} 		
        {if $pager->current > 1}<a href="{url s1=1}">首页</a>{/if}
        {if $pager->current > 1}<a href="{url s1=$pager->current-1}">上页</a>{/if}
        {if $pager->current < $pager->pages}<a href="{url s1=$pager->current+1}">下页</a>{/if}
        {if $pager->current < $pager->pages}<a href="{url s1=$pager->pages}">尾页</a>{/if}
    </div>
    <p>&nbsp;</p>
    <!-- {rights right='products_create'}<ul id="addmenu"><li><a href="{$site_admin}m=inventory&s=products.php&uri=create">添加一个新的产品信息</a></li></ul>{/rights} -->
</div>
{include file="admin/bottom.php"}
</body>
</html>
